const defaultMainChildren = [];

const routers = [{
    path: '/',
    name: "main",
    redirect: '/login',
    component: (resolve) => require(['@/view/layout/index.vue'], resolve), // 引入布局 所有页面属于子集
    children: defaultMainChildren.concat(
      [
        {
          path: '/homeStatistics',
          name: "资源预览",
          component: (resolve) => require(['@/view/home/homeStatistics.vue'], resolve),
          meta: {
            requireAuth: true // 添加该字段，表示进入这个路由是需要登录的
          }
        },
        {
          path: '/userManagement',
          name: "用户管理",
          component: (resolve) => require(['@/view/userManagement/index.vue'], resolve),
          meta: { requireAuth: true }
        },
        {
          path: '/approveApplication',
          name: "审批申请",
          component: (resolve) => require(['@/view/approveApplication/index.vue'], resolve),
          meta: { requireAuth: true }
        },
        {
          path: '/resourceRequest',
          name: "资源申请",
          component: (resolve) => require(['@/view/resourceRequest/index.vue'], resolve),
          meta: { requireAuth: true }
        },
        {
          path: '/myApplication',
          name: "我的申请",
          component: (resolve) => require(['@/view/myApplication/index.vue'], resolve),
          meta: { requireAuth: true }
        }
      ]
    ),

  },
  {
    path: '/login',
    name: "login",
    component: (resolve) => require(['@/view/login.vue'], resolve)
  }
];
export default routers;
